package za.org.meraka.cair.ontorepair;

import java.util.Set;
import java.util.HashSet;

import org.semanticweb.owlapi.model.OWLAxiom;

public class RepairGenerator {
		
	public RepairGenerator(){}
	
	public Set<Justification> getRepairSets(Set<Justification> set){
		Set<Set<OWLAxiom>> startSets = new HashSet<Set<OWLAxiom>>();
		Set<Justification> justifs = new HashSet<Justification>();
		
		for (Justification j: set)
			startSets.add(j.justification);
		
		HSGenerator<OWLAxiom> hsGen = new HSGenerator<OWLAxiom>(startSets);		
		Set<Set<OWLAxiom>> hittingSets = hsGen.getHittingSets();
		
		for (Set<OWLAxiom> h: hittingSets)
			justifs.add(new Justification(null, h));
		
		return justifs;
	}
	
	public Set<Set<OWLAxiom>> getRepairSets2(Set<Set<OWLAxiom>> sets){				
		HSGenerator<OWLAxiom> hsGen = new HSGenerator<OWLAxiom>(sets);		
		Set<Set<OWLAxiom>> hittingSets = hsGen.getHittingSets();
		
		return hittingSets;		
	}
	
}
